import request from "@/utils/request.js";

/**
 * 获取分页销售机会列表
 * @returns {Promise<PageDTO<SalesOpportunitiesVO>} 返回分页销售机会数据
 */
export function getOpportunitiesList(params) {
  return request.get("/sales-opportunity/list", params);
}

/**
 * 添加销售机会
 * @param {SalesOpportunitiesDTO} data 添加销售机会数据\
 */
export function addOpportunity(data) {
  return request.post("/sales-opportunity", data);
}

/**
 * 修改销售机会
 * @param {SalesOpportunitiesDTO} data 修改销售机会数据\
 */
export function updateOpportunity(data) {
  return request.put("/sales-opportunity", data);
}

/**
 * 删除销售机会
 */
export function deleteOpportunities(ids) {
  console.log(ids);
  return request.delete("/sales-opportunity/wx", { ids });
}
